/**
 * Created by baidm in 2022/4/14 on 8:00
 */
const baseSize = 16

const setRem = () => {
    const scale = document.documentElement.clientWidth / 1920
    let fontSize = baseSize * Math.min(scale, 2) > 12 ? baseSize * Math.min(scale, 2) : 12
    document.documentElement.style.fontSize = `${fontSize}px`
}

setRem()

window.onresize = () => {
    setRem()
}